package com.migu.rbac.repository;

import com.migu.rbac.model.SysBackApi;
import com.migu.rbac.vo.page.ApiPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description TODO :
 * @Author: zj
 * @Date: 16:21 2019/3/22
 * @Version 1.0
 **/
@Mapper
public interface SysBackApiRepository {
    //模糊查询path
    List<SysBackApi> findByPathStartsWithAndMethod(Map<String, String> map);

    //精确查询path
    SysBackApi findByPathAndMethod(Map<String, String> map);

    //查询所有path
    List<SysBackApi> findAllApi();

    //保存path
    int saveApi(SysBackApi api);

    //删除url
    int deleteUrl(int id);

    //添加前先查询存不存在
    int selectApiByProjectAndPath(SysBackApi sysBackApi);

    //修改url
    int updateUrlById(SysBackApi sysBackApi);

    //按条件查询url
    List<SysBackApi> selectApiByExample(ApiPage page);

    Integer selectApiCount();

    //获取id
    Integer selectIDByPathAndMethod(@Param("path") String path, @Param("method") String method);

    //删除backapi by menuid
    int deleteBackApiByMenuId(@Param("menuid") int menuid);

}
